<template>
  <div>
    <Ajax-test></Ajax-test>
    <button @click="getInfo">获取学生信息</button>
  </div>
</template>

<script>
import axios from 'axios'
import AjaxTest from './components/AjaxTest.vue'

export default {
  name: 'App',
  components: {
    AjaxTest
  },
  methods: {
    getInfo() {
      axios.get('http://127.0.0.1:8000/server').then(
        response => {
          console.log('请求成功', response.data)
        },
        error => {
          console.log('请求失败', error.message)
        }
      )
    }
  }
}
</script>

<style>
</style>